#!/usr/bin/gnuplot

reset
set terminal png

#########################################################################################################################
# HTTP
set out 'luna-http-qps.png' 
set xlabel "concurrent request"
set ylabel "QPS"
set title  "luna http QPS comparison"
set grid ytics lt 0 lw 1 lc rgb "#880000"
set grid xtics lt 0 lw 1 lc rgb "#0000ff"
plot "data-qps.txt" using 1:2 with linespoints pointtype 2 title "old luna", "data-qps.txt" using 1:3 with linespoints pointtype 3 title "new luna(with cpsadgen)", "data-qps.txt" using 1:4 with linespoints pointtype 4 title "new luna(without cpsadgen)"


set out 'luna-http-rt.png' 
set xlabel "concurrent request"
set ylabel "RT (ms)"
set title  "luna http RT comparison"
set grid ytics lt 0 lw 1 lc rgb "#880000"
set grid xtics lt 0 lw 1 lc rgb "#0000ff"
plot "data-rt.txt" using 1:2 with linespoints pointtype 2 title "old luna", "data-rt.txt" using 1:3 with linespoints pointtype 3 title "new luna(with cpsadgen)", "data-rt.txt" using 1:4 with linespoints pointtype 4 title "new luna(without cpsadgen)"



set out 'luna-http-cpu.png' 
set xlabel "concurrent request"
set ylabel "CPU utilization"
set title  "luna http CPU utilization comparison"
set grid ytics lt 0 lw 1 lc rgb "#880000"
set grid xtics lt 0 lw 1 lc rgb "#0000ff"
plot "data-cpu.txt" using 1:2 with linespoints pointtype 2 title "old luna", "data-cpu.txt" using 1:3 with linespoints pointtype 3 title "new luna(with cpsadgen)", "data-cpu.txt" using 1:4 with linespoints pointtype 4 title "new luna(without cpsadgen)"


#########################################################################################################################
# HSF
set out 'hsf-luna-http-qps.png' 
set xlabel "thread # to request"
set ylabel "QPS"
set title  "luna hsf QPS comparison"
set grid ytics lt 0 lw 1 lc rgb "#880000"
set grid xtics lt 0 lw 1 lc rgb "#0000ff"
plot "hsf-data-qps.txt" using 1:2 with linespoints pointtype 2 title "luna_hsf"


set out 'hsf-luna-http-rt.png' 
set xlabel "thread # to request"
set ylabel "RT (ms)"
set title  "luna hsf RT comparison"
set grid ytics lt 0 lw 1 lc rgb "#880000"
set grid xtics lt 0 lw 1 lc rgb "#0000ff"
plot "hsf-data-rt.txt" using 1:2 with linespoints pointtype 2 title "luna_hsf" 



set out 'hsf-luna-http-cpu.png' 
set xlabel "thread # to  request"
set ylabel "CPU utilization"
set title  "luna hsf CPU utilization comparison"
set grid ytics lt 0 lw 1 lc rgb "#880000"
set grid xtics lt 0 lw 1 lc rgb "#0000ff"
plot "hsf-data-cpu.txt" using 1:2 with linespoints pointtype 2 title "luna_hsf"  
